/**
 * 
 */
package com.ffcs.crmd.tsp.server.jdbc.support;

import com.ffcs.crmd.tsp.server.application.ApplicationManagerHolder;
import com.ffcs.crmd.tsp.server.core.QuartzSchedulerHandler;
import com.ffcs.crmd.tsp.server.jdbc.delegate.ServiceDelegate;
import com.ffcs.crmd.tsp.server.jdbc.delegate.ServiceDelegateTX;
import com.ffcs.crmd.tsp.server.manager.JobProcessManager;
import com.ffcs.crmd.tsp.server.manager.TaskRemotingManager;

/**
 * 功能说明:
 *
 * @author FFCS-ZHONGFUHUA
 * 
 * @since 
 *
 */
public class ServiceSupportTX extends ServiceSupportAbstract {
    
    /**
     * 
     */
    private ServiceDelegate        serviceDelegate     = new ServiceDelegateTX();
    
    /**
     * 
     */
    private QuartzSchedulerHandler quartzSchedulerHandler;
    
    /**
     * 
     */
    private JobProcessManager      jobProcessManager   = ApplicationManagerHolder.getBean("jobProcessManager", JobProcessManager.class);
    
    /**
     * 执行端通信管理者
     */
    private TaskRemotingManager    taskRemotingManager = ApplicationManagerHolder.getBean("taskRemotingManager", TaskRemotingManager.class);
    
    /**
     * 功能说明:
     * 
     * @return
     */
    @Override
    public boolean isAutoCommit() {
        return false;
    }
    
    /**
     * 功能说明:
     * 
     * @return
     */
    @Override
    public boolean isTxIsolationLevelSerializable() {
        return true;
    }
    
    /**
     * 功能说明:
     * 
     * @return
     */
    @Override
    protected ServiceDelegate getDelegate() {
        return serviceDelegate;
    }
    
    /**
     * 功能说明:
     * 
     * @param delegate
     */
    @Override
    protected void setDelegate(ServiceDelegate delegate) {
        this.serviceDelegate = delegate;
    }
    
    /**
     * 功能说明:
     * 
     * @return
     */
    @Override
    protected QuartzSchedulerHandler getQuartzSchedulerHandler() {
        return this.quartzSchedulerHandler;
    }
    
    /**
     * 功能说明: 设置quartzSchedulerHandler
     *
     * @param quartzSchedulerHandler quartzSchedulerHandler 
     */
    @Override
    public void setQuartzSchedulerHandler(QuartzSchedulerHandler quartzSchedulerHandler) {
        this.quartzSchedulerHandler = quartzSchedulerHandler;
    }
    
    /**
     * 功能说明: 获取jobProcessManager
     *
     * @return jobProcessManager jobProcessManager
     */
    @Override
    public JobProcessManager getJobProcessManager() {
        return jobProcessManager;
    }

    /**
     * 功能说明:
     * 
     * @return
     */
    @Override
    protected TaskRemotingManager getTaskRemotingManager() {
        return taskRemotingManager;
    }
    
}
